package com.userInfoService.service;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSON;
import com.userInfoService.entity.UserPojo;

@Component
public class MqSender {
	@Autowired
	private AmqpTemplate amqpTemplate;
	public void sendUserPojo(UserPojo userPojo) {
		amqpTemplate.convertAndSend("queue1", userPojo);
	}
	
	public void sendStr(UserPojo userPojo) {
		String str = JSON.toJSONString(userPojo);
		amqpTemplate.convertAndSend("queue2", str);
	}
}
